import wx.lib.newevent as newEvt
import wx
######################################  Game Object  ######################################

#constant of true and false
T = 1
F = 0
#constant of aspect
ASP_UP = 0
ASP_DOWN = 1
ASP_LEFT = 2
ASP_RIGHT = 3
ASP_LEFT_DOWN = 4
ASP_RIGHT_DOWN = 5
#constant of game object
GAME_OBJ_TOTAL = 14
GAME_OBJ_MASTER = 0
GAME_OBJ_BLACK = 1
GAME_OBJ_SAND = 2
GAME_OBJ_STONE_WALL = 3
GAME_OBJ_STONE_WALL_STRETCH = 4
GAME_OBJ_STONE_WALL_TURNABLE = 5
GAME_OBJ_UNDESTROY_WALL = 6
GAME_OBJ_EXIT = 7
GAME_OBJ_STONE = 8
GAME_OBJ_DIAMOND = 9
GAME_OBJ_BUTTERFLY = 10
GAME_OBJ_CUBE_MONSTER = 11
GAME_OBJ_GREEN_WATER = 12
GAME_OBJ_BURST_FIRE = 13
#size of each cube
SIZE_CUBE = (50,50)
#the view of map (row, column)
MAP_VIEW_RANGE = (10,10)
#directory and each File name of game object except master
DIR_GAME_OBJECT = "game object image"
LIST_FILENAME_GAMEOBJECT = [[],  #0
                            ["black.jpg"],  #1
                            ["earth.jpg"],  #2
                            ["stone wall.jpg"],  #3
                            ["stone wall.jpg", "stone wall-stretch.jpg"],  #4
                            ["stone wall.jpg","stone wall-change1.jpg","stone wall-change2.jpg"],  #5
                            ["undestroy.jpg"],  #6
                            ["undestroy.jpg","exit.jpg"],  #7
                            ["stone.jpg"],  #8
                            ["diomond.jpg"],  #9
                            ["butterfly1.jpg","butterfly2.jpg","butterfly3.jpg"],  #10
                            ["cube1.jpg","cube2.jpg","cube3.jpg"],  #11
                            ["green1.jpg","green2.jpg","green3.jpg","green4.jpg","green5.jpg"],  #12
                            ["fire1.jpg","fire2.jpg","fire3.jpg"]]  #13
#table of moving / stretching object v.s. all object is obstacle
#------------------------------------------------------ 0  1  2  3  4  5  6  7  8  9 10 11 12 13
LIST_IS_OBSTACLE = {str(GAME_OBJ_MASTER) :             [T, F, F, T, T, T, T, T, T, F, T, T, T, T],
                    str(GAME_OBJ_STONE_WALL_STRETCH) : [T, F, T, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_STONE) :              [T, F, T, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_DIAMOND) :            [T, F, T, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_BUTTERFLY) :          [T, F, T, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_CUBE_MONSTER) :       [T, F, T, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_GREEN_WATER) :        [T, F, F, T, T, T, T, T, T, T, T, T, T, T],
                    str(GAME_OBJ_BURST_FIRE) :         [F, F, F, F, F, F, T, F, F, F, F, F, F, T]}
#table of game object to contacted object is bursting
LIST_CONTACT_BURST = {str(GAME_OBJ_BUTTERFLY) : [GAME_OBJ_MASTER, GAME_OBJ_GREEN_WATER],
                      str(GAME_OBJ_CUBE_MONSTER) : [GAME_OBJ_MASTER, GAME_OBJ_GREEN_WATER]}
#table of falling object can move left/right when there is a object of which at down
LIST_DOWN_OBJ_FALL_LR = [GAME_OBJ_STONE_WALL, GAME_OBJ_STONE_WALL_STRETCH, GAME_OBJ_STONE, GAME_OBJ_DIAMOND]
#table of object to bursting product
LIST_BURST_PRODUCT = {str(GAME_OBJ_BUTTERFLY) : GAME_OBJ_DIAMOND}
#list of creature
LIST_CREATURE = [GAME_OBJ_MASTER, GAME_OBJ_BUTTERFLY, GAME_OBJ_CUBE_MONSTER]
#directory and each image file name of master according to direction
DIR_MASTER = "master"
LIST_FILENAME_MASTER = ["player.jpg", "player.jpg", "player-left.jpg", "player-right.jpg"]
#constant of bursting type
BURST_TYPE_3X3 = 0
#constant of stretching type of stone wall
STONE_WALL_STRETCH_LEFT_RIGHT = 0
#my event
NewEvt_gameEnd, EVT_GAME_END = newEvt.NewEvent()
NewEvt_eatDiamond, EVT_EAT_DIAMOND = newEvt.NewEvent()
NewEvt_DestroyGameObj, EVT_DESTROY_GAME_OBJ = newEvt.NewEvent()
NewEvt_pushStone, EVT_PUSH_STONE = newEvt.NewEvent()
NewEvt_HitTurnableStoneWall, EVT_HIT_TURN_STONE_WALL = newEvt.NewEvent()
NewEvt_openExit, EVT_OPEN_EXIT = newEvt.NewEvent()
NewEvt_openDoor, EVT_OPEN_DOOR = newEvt.NewEvent()
NewEvt_addScore, EVT_ADD_SCORE = newEvt.NewEvent()
#image type
IMAGE_TYPE = [[".jpg", wx.BITMAP_TYPE_JPEG],[".jpeg", wx.BITMAP_TYPE_JPEG],
              [".bmp", wx.BITMAP_TYPE_BMP],[".gif", wx.BITMAP_TYPE_GIF],
              [".png", wx.BITMAP_TYPE_PNG]]
#constant of using for recording going position
POS_OBSTACLE = 0
POS_EVER_GO = 1
POS_NOT_GO = 2
#pause time of playering walking(1/1000sec)
PLAYER_PAUSE_TIME = 200

######################################  Score board  ######################################

#directory of storing image of score board
DIR_IMG_SCORE_BOARD = "img score board"
#size of image label
SIZE_IMG_LABEL = (60,60)
#size of score board
SIZE_BOARD = (260, 500)
#file name of storing score list
FILE_SCORE = "score file/score.txt"
#initial life of player
INITIAL_LIFE = 6
#score value
SCORE_EAT_DIAMOND = 8
SCORE_PUSH_STONE = 3
SCORE_BURST = 10
SCORE_LIFE = 1000

######################################  Frame - main  ######################################

#constant of selection
SEL_NEW_GAME = 0
SEL_EDIT_MAP = 1
SEL_OPTION = 2
SEL_HELP = 3
SEL_QUIT = 4
#directory of storing all image of main frame
DIR_IMG_MAIN_FRAME = "img main frame"
#selection image
LIST_SELECTION_IMG = [["img_newGame1.png", "img_newGame2.png"],
                      ["img_editMap1.png", "img_editMap2.png"],
                      ["img_option1.png", "img_option2.png"],
                      ["img_help1.png", "img_help2.png"],
                      ["img_quit1.png", "img_quit2.png"]]
#people image of selection
LIST_PEOPLE_IMG = [DIR_IMG_MAIN_FRAME, "1.png", "2.png", "3.png", "4.png"]
#file name of background image
FILE_NAME_BACKGROUND = "background/background.jpg"
#file name of title diamond image
FILE_NAME_DIAMOND = DIR_IMG_MAIN_FRAME + "/img_diamond.png"
#file name of text image of title
FILE_NAME_TITLE = DIR_IMG_MAIN_FRAME + "/img_title.png"

######################################  Frame - new game  ######################################

#directory of map
DIR_MAP_INFO = "map"
#file name of map information
FILE_NAME_MAP_INFO = "mapInfo.txt"
#file name of map description
FILE_NAME_MAP_DESCRIPTION = "description.txt"
#directory of storing all image of frame of new game
DIR_IMG_NEW_GAME = "img new game"
#file name of image border
FILE_NAME_IMG_BORDER = DIR_IMG_NEW_GAME + "/border.png"
#file name of people image
DILE_NAME_ING_PEOPLE = DIR_IMG_NEW_GAME + "/people.png"
#size of selection bar
SIZE_SELECTION_BAR = (187,400)
#maximum number of selection appearance at a time
MAX_SEL_APPEAR = 10

######################################  Door animation  ######################################

#directory of storing image of door
DIR_IMG_DOOR = "img door"
#constant of door type
DOOR_TYPE_LOST = 0
DOOR_TYPE_WIN = 1
DOOR_TYPE_START = 2
DOOR_TYPE_FINISH = 3
#moving distance at a time
A_TIME_MOVE_DIST = 10

###################################### MainMap ###########################################

#constant of functional button
FUNC_CONTINUE = 0
FUNC_BURST_MYSELF = 1
FUNC_LEAVE = 2

#constant of way to ending game
END_GAME_GO_EXIT = 0
END_GAME_MASTER_DIE = 1
END_GAME_TIME_UP = 2

###################################### SelPlayer ###########################################

#directory of storing image of selPlayer
DIR_IMG_SEL_PLAYER = "img select a master"

###################################### Edit Map ############################################

#constant of range of time-minute
RANGE_MINUTE = (0, 100)
#constant of range of time-second
RANGE_SECOND = (0, 59)
#constant of range of target diamond number
RANGE_DIAMOND = (1, 999)
#constant of range of waiting time of green water to stretch
RANGE_GREEN_WATER_WAIT_RANGE = (1, 50)
#constant of range of lasting time of effect of turnable wall
RANGE_TURNABLE_WALL_RANGE = (1, 999)
#constant of minimum map dimension
MAP_DIMENSION_MIN = (10, 10)
#constant of maximum map dimension
MAP_DIMENSION_MAX = (100, 100)
#constant of menu type
MENU_TYPE_COMMON = 0
MENU_TYPE_CHECK = 1
MENU_TYPE_SEPERATOR = 2
#directory of head image
DIR_HEAD_IMAGE = "head image"
#directory of saving temporary map
DIR_TEMP_MAP = "temp map"

####################################### Sound #############################################

#directory of storing all sound file
DIR_SOUND = "sound"
#constant of effect sound
SOUND_BURST = 0
SOUND_WATER = 1
SOUND_ENTER = 2
SOUND_SELECT = 3
SOUND_BURP = 4
SOUND_PUSH_BUTTON = 5
#constant of title music
MUSIC_TITLE = 0
#total number of background music
TOTAL_MUSIC = 4

######################################## Help ########################################

#directory of storing image of people
DIR_IMG_PEOPLE = "people image"
#directory of storing image of help
DIR_IMG_HELP = "img help"